package api

import "kumachan/interpreter/runtime/rt"


func __UnsafeArbitraryValue() rt.Value {
	type unsafe_arbitrary_value struct { foo struct{}; bar struct{} }
	return unsafe_arbitrary_value {}
}

func __Panic(msg string) rt.Value {
	panic("programmed panic: " + msg)
}

func __Assert(ok_ rt.EnumValue, k rt.Value, h rt.InteropContext) rt.Value {
	var ok = rt.FromBool(ok_)
	if ok {
		return h.Call(k, nil)
	} else {
		panic("assertion failed")
	}
}

func __ForceUnwrap(maybe rt.EnumValue) rt.Value {
	var value, ok = rt.Unwrap(maybe)
	if ok {
		return value
	} else {
		panic("expect some value but got None")
	}
}


